import React from 'react';
import { Redirect } from 'umi';

const AuthRouter = (props: any) => {
  // 这个根据自己判断是否登录
  const token = window.sessionStorage.getItem('user') ? true : false;
  return token ? <div>{props.children}</div> : <Redirect to="/login" />;
};

export default AuthRouter;
